import React from 'react';
import styles from './index.module.css';
import {Button} from 'antd';
import clsx from 'clsx';

interface IUploadProps {
    name: string;
    onFinish: (url: string) => void;
    visible: boolean;
}

// 帮助按钮组件
export const UploadImage: React.FC<IUploadProps> = (props: IUploadProps) => {
    const name = props.name;
    const visible = props.visible;

    console.log(visible)

    const handleUpload = (): void => {

    };

    return <div
        className={clsx(styles.uploadContainer, name, visible ? '' : styles.hidden)}>
       <div className={styles.content}>
           <div className={styles.texts}>
               <div className={styles.text1}>替换图片</div>
               <div className={styles.text2}>只支持 JPG/PNG,大小不超过2M</div>
               <div className={styles.text2}>建议尺寸2388X1668</div>
           </div>
           <Button type={"primary"} onClick={handleUpload}>上传</Button>
       </div>
    </div>
}